using System;
using System.Drawing;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using Weazel.Toad.Application.Actions;

namespace Weazel.Toad.Application.Controls.ProjectToolStrip
{
  public class ProjectToolStrip
    : ToadToolStrip
  {
    private ToolStripButton newProjectButton;
    private ToolStripButton openProjectButton;
    private ToolStripButton closeProjectButton;

    public ProjectToolStrip()
    {
      Image newProjectImage = GraphicsLoader.LoadImage(GetType(), "newproject.png");
      Image openProjectImage = GraphicsLoader.LoadImage(GetType(), "open_project.png");
      Image closeProjectImage = GraphicsLoader.LoadImage(GetType(), "close_project.png");
      

      this.newProjectButton = new ToolStripButton(newProjectImage);
      this.newProjectButton.ToolTipText = "New Project";

      this.openProjectButton = new ToolStripButton(openProjectImage);
      this.openProjectButton.ToolTipText = "Open Project";

      this.closeProjectButton = new ToolStripButton(closeProjectImage);
      this.closeProjectButton.ToolTipText = "Close Project";

      this.Items.AddRange(
        new ToolStripItem[] {
          newProjectButton,
          openProjectButton,
          closeProjectButton
        }
      );
    }

    public override void BindActions()
    {
      ActionBase.Actions[typeof(NewProjectAction)].BindToolStripItem(newProjectButton);      
      ActionBase.Actions[typeof(OpenProjectAction)].BindToolStripItem(openProjectButton);
      ActionBase.Actions[typeof(CloseProjectAction)].BindToolStripItem(closeProjectButton);
    }
  }
}
